package org.carabiner.infinitest;

import java.awt.event.MouseEvent;

import javax.swing.JTree;
import javax.swing.tree.TreePath;

class ResultsTree extends JTree
{
  public ResultsTree(ResultTreeModel testResults)
  {
    super(testResults);
  }

  @Override
  public String getToolTipText(MouseEvent event)
  {    
    TreePath path = getPathForLocation(event.getPoint().x, event.getPoint().y);
    if (path != null)
    {
      InfinitestTreeNode node = (InfinitestTreeNode) path.getLastPathComponent();     
      return node.getToolTip();
    }
    return super.getToolTipText(event);
  }

}
